﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ProteinInsightPlugin
{
    public partial class InputDialog : Form
    {
        public double contactLen = 5.0;

        public InputDialog()
        {
            InitializeComponent();
        }

        private void InputDialog_Load(object sender, EventArgs e)
        {

        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            try
            {            
                contactLen = Convert.ToDouble(this.textBoxContactLength.Text);
            } 
            catch (Exception)
            {
                string message = "Not a number";
                MessageBox.Show(message);
                return;
            }

            if ( contactLen < 1.0 )
            {
                MessageBox.Show("Contact len is larger than 1.0");
                return;
            }

            DialogResult = DialogResult.OK;
        }
    }
}
